-
Notifications
You must be signed in to change notification settings - Fork 15k
uxrce_dds: support multi-instance uORB topics #26305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
beniaminopozzan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add dedicated message type for auxiliary global position sources. Separates aux_global_position from VehicleGlobalPosition topic. Includes source field for identifying position source type.
Add per-instance parameters (ID, CTRL, MODE, DELAY, NOISE, GATE) for up to 4 auxiliary global position sources.
- Refactor aux_global_position into manager + per-source AgpSource class - Support up to 4 independent AGP sources simultaneously - Dynamic parameter lookup without boilerplate switch statements - Per-source state tracking and fusion logic - Update simulator to use new AuxGlobalPosition message
Enable DDS bridge to handle multi-instance uORB topics by mapping multiple topic instances to a single DDS topic with instance field.
e12ad30 to
7e8de5e
Compare
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 2016 byte (0.1 %)]px4_fmu-v6x [Total VM Diff: 1968 byte (0.1 %)]Updated: 2026-01-21T16:40:49 |
| } | ||
|
|
||
| ekf.resetAidSourceStatusZeroInnovation(aid_src); | ||
| int32_t AuxGlobalPosition::getModeParam(int instance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I see these can be called frequently and thus should be cached (specifically the param_get(param_find calls).
| uint64 timestamp # [us] Time since system start | ||
| uint64 timestamp_sample # [us] Timestamp of the raw data | ||
|
|
||
| uint8 id # Unique identifier for the AGP source | ||
| uint8 source # 0: Unkown, 1: GNSS, 2: Vision, 3: Pseudolites, 4: Terrain, 5: Magnetic, 6: Estimator | ||
|
|
||
| float64 lat # [deg] Latitude in WGS84 | ||
| float64 lon # [deg] Longitude in WGS84 | ||
| float32 alt # [m] Altitude above mean sea level (AMSL) | ||
|
|
||
| float32 eph # [m] Standard deviation of horizontal position error | ||
| float32 epv # [m] Standard deviation of vertical position error | ||
|
|
||
| uint8 lat_lon_reset_counter # Counter for reset events on horizontal position coordinates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to https://docs.px4.io/main/en/uorb/uorb_documentation
| uint64 timestamp # [us] Time since system start | |
| uint64 timestamp_sample # [us] Timestamp of the raw data | |
| uint8 id # Unique identifier for the AGP source | |
| uint8 source # 0: Unkown, 1: GNSS, 2: Vision, 3: Pseudolites, 4: Terrain, 5: Magnetic, 6: Estimator | |
| float64 lat # [deg] Latitude in WGS84 | |
| float64 lon # [deg] Longitude in WGS84 | |
| float32 alt # [m] Altitude above mean sea level (AMSL) | |
| float32 eph # [m] Standard deviation of horizontal position error | |
| float32 epv # [m] Standard deviation of vertical position error | |
| uint8 lat_lon_reset_counter # Counter for reset events on horizontal position coordinates | |
| uint64 timestamp # [us] Time since system start | |
| uint64 timestamp_sample # [us] Timestamp of the raw data | |
| uint8 id # Unique identifier for the AGP source | |
| uint8 source # 0: Unkown, 1: GNSS, 2: Vision, 3: Pseudolites, 4: Terrain, 5: Magnetic, 6: Estimator | |
| float64 lat # [deg] Latitude in WGS84 | |
| float64 lon # [deg] Longitude in WGS84 | |
| float32 alt # [m] Altitude above mean sea level (AMSL) | |
| float32 eph # [m] Standard deviation of horizontal position error | |
| float32 epv # [m] Standard deviation of vertical position error | |
| uint8 lat_lon_reset_counter # Counter for reset events on horizontal position coordinates |
|
@beniaminopozzan Will this need docs, and if so can you work with @haumarco to make them happen? |
|
@hamishwillee sure! @haumarco why did the non-uxrcedds changes have been added to this PR? shall it go back to draft? |
This PR is part of the split up of #26151
Solved Problem
The DDS bridge could only map single-instance uORB topics to DDS topics. This prevented external systems from publishing multiple instances of the same message type (e.g., multiple positioning sources) through separate DDS topics.
Solution
This PR adds multi-instance uORB topic support to the DDS bridge:
Topic mapping configuration
instancesfield to specify number of topic instances_A,_B,_C,_D) for DDS topic namesCode generation updates
PublicationMultiarrays for multi-instance subscriptions/fmu/in/aux_global_position_A→aux_global_positioninstance 0Changelog Entry
For release notes:
Test coverage
Tested with
aux_global_positiontopic configured for 4 instances.Additional Notes
This is a prerequisite for multi-instance AGP fusion in EKF2. The same pattern can be extended to other multi-instance topics (e.g., distance sensors, external odometry sources).